import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// import { createRouter, createWebHashHistory, RouteRecordRaw } from './grouter'
import { routerTable } from './router-table'

// 新建路由实例
const router = createRouter({
    // 使用hash模式路由
    history: createWebHistory(), // 参数与vite配置中base保持一致
    routes: [
        {
            path: '/',
            name: 'index',
            redirect: '/login',
            meta: {
              title: '默认页面'
            }
        },
        {
            path: '/login',
            component: () => import('../views/Login.vue'),
            name: 'Login',
            meta: {
                title: '登录',
            },
        },
        ...routerTable
    ],
})
export default router